package cn.chencq.spider.novel.utils;

import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 读取配置文件
 * 
 * @author chencq
 * 
 */
public class SpiderConfigUtil {

	private static Logger logger = LoggerFactory.getLogger(SpiderConfigUtil.class);

	private static final Properties SYS_PROPERTIES = Utils.getProperties("spider.novel.properties");

	/**
	 * get sys pros.
	 * 
	 * @return
	 */
	public static Properties getSysProperties() {
		return SYS_PROPERTIES;
	}

	/**
	 * 失败重试次数
	 * 
	 * @return
	 */
	public static int getRetryTime() {
		int retryTime = 1;
		try {
			retryTime = Integer.parseInt(SYS_PROPERTIES.getProperty("spider.retryTime"));
		} catch (RuntimeException e) {
			logger.error("读取 spider.retryTime配置出错！");
		}
		return retryTime;
	}

}
